﻿<h3>
    Features - Classes - Class Declaration</h3>
<hr>
<p>
    A simple way to define classes that allows for type checking and polymorphism.</p>
<h4>
    Example</h4>
<pre>// Define a namespace
$.class.ns("Joo");

// Define the Pet class.
Joo.Pet = $.class.define(function(name) {

	// Private Members
	var _name = name;
	var _walkCount = 0;

	// Public Members
	var self = {
		walk : function() {
			_walkCount++;
			return _name
				+ " has been walked "
				+ _walkCount
				+ " time(s) today.";
		};
	};

	return self;
});

// Instantiate a pet object.
var pet = new Joo.Pet("Taboo");

// Call the public Walk method
pet.walk(); // Taboo has been walked 1 time(s) today.
pet.walk(); // Taboo has been walked 2 time(s) today.</pre>
